package com.hfzy.ihk.web.linkcall.biz;

import com.hfzy.ihk.common.core.elasticsearch.service.EsBaseServiceImpl;
import com.hfzy.ihk.facade.linkcall.entity.TestEntity;
import com.hfzy.ihk.facade.linkcall.entity.TestLog;
import com.hfzy.ihk.web.linkcall.dao.TestLogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.repository.ElasticsearchCrudRepository;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by Administrator on 2018/7/19.
 *
 *  业务逻辑
 * @author wws
 */
@Component
public class LogBiz extends EsBaseServiceImpl<TestEntity> {

    @Autowired
    TestLogRepository testLogRepository;

    @Override
    protected ElasticsearchCrudRepository getReposity() {
        return testLogRepository;
    }


    public boolean addLog(TestLog log){
        testLogRepository.save(log);
        return true;
    }
    public boolean addLog(List<TestLog> log){
        testLogRepository.saveAll(log);
        return true;
    }
}
